<?php
  require(dirname(__FILE__).'/global.php');
  require(ROOT.'/admin/isLogin.php');     
  
  $submit = $_POST['submit'];
  if(isset($submit))
  {
      $tables = $_POST['tables'];
      if(!empty($tables))
      {
          $tables = implode(",",$tables);
          $db->backup($tables);
          $smarty->assign('tip','备份成功');
      }
      else{                                
          $smarty->assign('tip','请选择数据表');
      }
  }
  $sql = 'show table status';
  $array = $db->query($sql);
      
  $smarty->assign('array',$array);
  $smarty->display('db_export.html');
  $db->close();
?>
